/*
 * Selling Partner API for Listings Items
 *
 * The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API.  For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide).
 *
 * The version of the OpenAPI document: 2021-08-01
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = software.amzn.spapi.Client.OpenAPIDateConverter;

namespace software.amzn.spapi.Model.listings.items.v2021_08_01
{
    /// <summary>
    /// Offer details of a listings item for an Amazon marketplace.
    /// </summary>
    [DataContract(Name = "ItemOfferByMarketplace")]
    public partial class ItemOfferByMarketplace : IValidatableObject
    {
        /// <summary>
        /// Type of offer for the listings item.
        /// </summary>
        /// <value>Type of offer for the listings item.</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum OfferTypeEnum
        {
            /// <summary>
            /// Enum B2C for value: B2C
            /// </summary>
            [EnumMember(Value = "B2C")]
            B2C = 1,

            /// <summary>
            /// Enum B2B for value: B2B
            /// </summary>
            [EnumMember(Value = "B2B")]
            B2B = 2
        }


        /// <summary>
        /// Type of offer for the listings item.
        /// </summary>
        /// <value>Type of offer for the listings item.</value>
        [DataMember(Name = "offerType", IsRequired = true, EmitDefaultValue = true)]
        public OfferTypeEnum OfferType { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="ItemOfferByMarketplace" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ItemOfferByMarketplace() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ItemOfferByMarketplace" /> class.
        /// </summary>
        /// <param name="marketplaceId">The Amazon marketplace identifier. (required).</param>
        /// <param name="offerType">Type of offer for the listings item. (required).</param>
        /// <param name="price">price (required).</param>
        /// <param name="points">points.</param>
        /// <param name="audience">audience.</param>
        public ItemOfferByMarketplace(string marketplaceId = default(string), OfferTypeEnum offerType = default(OfferTypeEnum), Money price = default(Money), Points points = default(Points), Audience audience = default(Audience))
        {
            // to ensure "marketplaceId" is required (not null)
            if (marketplaceId == null)
            {
                throw new ArgumentNullException("marketplaceId is a required property for ItemOfferByMarketplace and cannot be null");
            }
            this.MarketplaceId = marketplaceId;
            this.OfferType = offerType;
            // to ensure "price" is required (not null)
            if (price == null)
            {
                throw new ArgumentNullException("price is a required property for ItemOfferByMarketplace and cannot be null");
            }
            this.Price = price;
            this.Points = points;
            this.Audience = audience;
        }

        /// <summary>
        /// The Amazon marketplace identifier.
        /// </summary>
        /// <value>The Amazon marketplace identifier.</value>
        [DataMember(Name = "marketplaceId", IsRequired = true, EmitDefaultValue = true)]
        public string MarketplaceId { get; set; }

        /// <summary>
        /// Gets or Sets Price
        /// </summary>
        [DataMember(Name = "price", IsRequired = true, EmitDefaultValue = true)]
        public Money Price { get; set; }

        /// <summary>
        /// Gets or Sets Points
        /// </summary>
        [DataMember(Name = "points", EmitDefaultValue = false)]
        public Points Points { get; set; }

        /// <summary>
        /// Gets or Sets Audience
        /// </summary>
        [DataMember(Name = "audience", EmitDefaultValue = false)]
        public Audience Audience { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("class ItemOfferByMarketplace {\n");
            sb.Append("  MarketplaceId: ").Append(MarketplaceId).Append("\n");
            sb.Append("  OfferType: ").Append(OfferType).Append("\n");
            sb.Append("  Price: ").Append(Price).Append("\n");
            sb.Append("  Points: ").Append(Points).Append("\n");
            sb.Append("  Audience: ").Append(Audience).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public virtual string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}
